
//----------------------------------------------------
// Find the movie object. 
function movieobject( moviename ) {

	if ( document.all ) {
		return document.all[moviename];
		
	} else if ( document.getElementById( moviename ) ) {
		return document.getElementById( moviename );
		
	} else if (document.layers ) {
		return document.layers['image'].document.embeds[moviename];
	}
}

//----------------------------------------------------
// Tell the Flash movie to set a variable
function setvar( moviename, name, value ) {

	var this_object = movieobject( moviename );
	
	if (this_object) {
		this_object.SetVariable( name, value );
	}
	
}

//----------------------------------------------------

function popNewWindow(args){
	var aryArgs = args.split(",");
	
	var sTitle = aryArgs[0];
	var iHeight = parseInt(aryArgs[1]);
	var iWidth = parseInt(aryArgs[2]);
	var sPath = pathDepth+"/images/" + aryArgs[3];
	var sParam = "height="+iHeight+",width="+iWidth+",toolbar=no,scrollbars=no";
	var exampleWin = window.open(sPath,sTitle,sParam);
	exampleWin.focus();
}
function popNewResizableWindow(args){
	var aryArgs = args.split(",");
	
	var sTitle = aryArgs[0];
	var iHeight = parseInt(aryArgs[1]);
	var iWidth = parseInt(aryArgs[2]);
	var sPath = pathDepth+"/images/" + aryArgs[3];
	var sParam = "height="+iHeight+",width="+iWidth+",resizable=yes,toolbar=no,scrollbars=no";
	var exampleWin = window.open(sPath,sTitle,sParam);
	exampleWin.focus();
}
var disCCBtn = false;
var disMediaBtn = false;
function theMovie_DoFSCommand( command, args ) {
	
	//alert( "Dave debug: " + command + "\n" + args );
	if ( command == "testMsg" ) {	
		alert(args);		
	}
	
	if ( command == "enableBtn" ) {	
		enableButton(args);		
	}
	
	if ( command == "disableBtn" ) {	
		disableButton(args);		
	}

	//pushes all variables from html to flash
	if(command == "getVariables")
	{
		var varName;
		var varValue;
		var searchstring = window.document.all['content'].innerHTML;
		var startIndex = searchstring.indexOf('&amp;');
		var endIndex = searchstring.indexOf('=');
		while (startIndex != -1) {
			varName = searchstring.substring(startIndex+5,endIndex);
			startIndex = endIndex+1;
			endIndex = searchstring.indexOf('&amp;',startIndex);
			varValue = searchstring.substring(startIndex,endIndex);
			setvar( moviename, varName, varValue );
			startIndex = searchstring.indexOf('&amp;',endIndex+1);
			endIndex = searchstring.indexOf('=',startIndex);
		}
		
		searchstring = window.document.getElementsByTagName("head")[0].innerHTML;
		startIndex = searchstring.indexOf('&');
		endIndex = searchstring.indexOf('=',startIndex+1);
		while (startIndex != -1) {
			varName = searchstring.substring(startIndex+1,endIndex);
			startIndex = endIndex+1;
			endIndex = searchstring.indexOf('&',startIndex);
			varValue = searchstring.substring(startIndex,endIndex);
			setvar( moviename, varName, varValue );
			oldStartIndex = startIndex;
			startIndex = searchstring.indexOf('&',endIndex+1);
			endIndex = searchstring.indexOf('=',startIndex);
			if(startIndex < oldStartIndex)
			{
				startIndex = -1;
			}
		}
		setvar( moviename, "strBlockID", blockID );
		setvar( moviename, "variablesSet", "true" );
	}
	
	//for subtopic jump pages
	if(command == "subTopicGetVariables")
	{
		var varName;
		var varValue;
		var searchstring = window.document.all['content'].innerHTML;
		var startIndex = searchstring.indexOf('&amp;');
		var endIndex = searchstring.indexOf('=');
		while (startIndex != -1) {
			varName = searchstring.substring(startIndex+5,endIndex);
			startIndex = endIndex+1;
			endIndex = searchstring.indexOf('&amp;',startIndex);
			varValue = searchstring.substring(startIndex,endIndex);
			setvar( moviename, varName, varValue );
			startIndex = searchstring.indexOf('&amp;',endIndex+1);
			endIndex = searchstring.indexOf('=',startIndex);
		}
		
		searchstring = window.document.getElementsByTagName("head")[0].innerHTML;
		startIndex = searchstring.indexOf('&');
		endIndex = searchstring.indexOf('=',startIndex+1);
		while (startIndex != -1) {
			varName = searchstring.substring(startIndex+1,endIndex);
			startIndex = endIndex+1;
			endIndex = searchstring.indexOf('&',startIndex);
			varValue = searchstring.substring(startIndex,endIndex);
			setvar( moviename, varName, varValue );
			oldStartIndex = startIndex;
			startIndex = searchstring.indexOf('&',endIndex+1);
			endIndex = searchstring.indexOf('=',startIndex);
			if(startIndex < oldStartIndex)
			{
				startIndex = -1;
			}
		}
		var beenThere = Global.getGlobal(moviename + "BT");
		if(beenThere != null)
		{
			setvar( moviename, "strbeenThere", beenThere );
		}
		setvar( moviename, "strBlockID", blockID );
		setvar( moviename, "variablesSet", "true" );
		
		var sequence = Global.getGlobal("scoreInSequence");

		if(sequence != null)
		{
			setvar( moviename, "strSequenceScore", sequence );
		}
		
		var steps = Global.getGlobal("stepArray");
		if(steps != null)
		{
			setvar( moviename, "strSteps", steps );
		}
	}
	
	if ( command == "subTopicJump" ) {
		var aryArgs = args.split(",");
		Global.setGlobal(moviename + "BT","true",parseInt(aryArgs[0]));
		window.location = pageName+"s0"+aryArgs[0]+"p"+aryArgs[1]+".html";
	}
/////////////////////////////////////////////////////////////////////////////////////////////////---Added by BC and KW 2-18-05	
	if ( command == "AdjustFire20030010" ) {
		Global.setGlobal("AFOTFactor",parseFloat(args));
	}
	
	if(command == "getVariables20030010")
	{
		var varName;
		var varValue;
		var searchstring = window.document.all['content'].innerHTML;
		var startIndex = searchstring.indexOf('&amp;');
		var endIndex = searchstring.indexOf('=');
		var OTFactor = Global.getGlobal("AFOTFactor");
		while (startIndex != -1) {
			varName = searchstring.substring(startIndex+5,endIndex);
			startIndex = endIndex+1;
			endIndex = searchstring.indexOf('&amp;',startIndex);
			varValue = searchstring.substring(startIndex,endIndex);
			setvar( moviename, varName, varValue );
			startIndex = searchstring.indexOf('&amp;',endIndex+1);
			endIndex = searchstring.indexOf('=',startIndex);
		}
		
		searchstring = window.document.getElementsByTagName("head")[0].innerHTML;
		startIndex = searchstring.indexOf('&');
		endIndex = searchstring.indexOf('=',startIndex+1);
		while (startIndex != -1) {
			varName = searchstring.substring(startIndex+1,endIndex);
			startIndex = endIndex+1;
			endIndex = searchstring.indexOf('&',startIndex);
			varValue = searchstring.substring(startIndex,endIndex);
			setvar( moviename, varName, varValue );
			oldStartIndex = startIndex;
			startIndex = searchstring.indexOf('&',endIndex+1);
			endIndex = searchstring.indexOf('=',startIndex);
			if(startIndex < oldStartIndex)
			{
				startIndex = -1;
			}
		}
		setvar( moviename, "strBlockID", blockID );
		setvar( moviename, "variablesSet", "true" );
		setvar( moviename, "TheOTFactor", OTFactor );
	}
	
	if ( command == "PEJump" ) {
		var aryArgs = args.split(",");
		var stepNum = Global.getGlobal("stepInSequence");
		
		if(stepNum != null)
		{
			if((parseInt(stepNum) + 1) != parseInt(aryArgs[0]))
			{
				Global.setGlobal("scoreInSequence",false);
				Global.setGlobal("stepInSequence",parseInt(stepNum)+1);
			}
			else
			{
				Global.setGlobal("stepInSequence",parseInt(stepNum)+1);
			}
			Global.setGlobal("stepArray",(parseInt(stepNum) + 1),parseInt(aryArgs[0]));
		}
		else
		{
			if(aryArgs[0]!= "1")
			{
				Global.setGlobal("scoreInSequence",false);
				Global.setGlobal("stepInSequence",1);
			}
			else
			{
				Global.setGlobal("stepInSequence",1);
			}
			Global.setGlobal("stepArray",1,parseInt(aryArgs[0]));
		}
		
		Global.setGlobal(moviename + "BT","true",parseInt(aryArgs[0]));
		window.location = aryArgs[1];
	}
	
	// These are used to show/hide the flash timed html text
	if ( command == "getPagename" ) {	
		setvar( moviename, "pageName", pageName );		
	}
	
	if ( command == "setScore") {
		var aryArgs = args.split(",");
		var aryTest;
		var strTest;
		aryArgs[0] = aryArgs[0].toLowerCase();
		if (aryArgs[0]=="true"){
			aryArgs[0] = true;
		}else{
			aryArgs[0] = false;
		}
		aryArgs[1] = parseInt(aryArgs[1]);
		strTest = Global.getGlobal('scoreArray');
		if(strTest != null)
		{
			aryTest = strTest.split(",");
			if(aryTest[aryArgs[1]] != "false")
			{
				Global.setGlobal('scoreArray',aryArgs[0],aryArgs[1]);
			}
		}
		else
		{
			Global.setGlobal('scoreArray',aryArgs[0],aryArgs[1]);
		}
	}
	
	if ( command == "setStatInfo" && args != "") {	
		switch(args){
			case "1":
				statInfoTxt="Click the forward arrow to continue";
				break;
				
			case "2":
				statInfoTxt="Complete this COL, and click the forward arrow to continue";
				break;
				
			case "3":
				statInfoTxt="Click BOOKMARK and EXIT to return to the lesson menu and choose another lesson";
				break;
				
			case "4":
				statInfoTxt="Complete this practical exercise, and click the forward arrow to continue";
				break;
				
			default:
				statInfoTxt=args;
				break;
		}
		statinfo.innerText = statInfoTxt;
	}
	
	if (command =="disMedia"){
		RollOverGeneric('replay','dis');
		disMediaBtn = true;
	}
	 
	if ( command == "pageDone" ) {	
		highlightNextButton();		
	}
	
	if ( command == "popWindow" ) {	
		popNewWindow(args);		
	}
	if ( command == "popResizableWindow" ) {	
		popNewResizableWindow(args);		
	}
	
	if ( command == "popCalc" ) {	
		openCalc();		
	}
	
	if (command == "initVars"){
		setvar( moviename, "strPageURL", document.location.href );
		setvar( moviename, "strBlockID", blockID );
	}
	
	if (command == "initSummary"){
		setvar( moviename, "strPageURL", document.location.href );
		setvar( moviename, "strBlockID", blockID );
		if(Global.getGlobal('scoreArray')!=null){window.document.exercisesummaryV2.SetVariable('scores',Global.getGlobal('scoreArray'));}
	}
	
	if (command == "initSummaryV115"){
		setvar( moviename, "strPageName", pageName);
		setvar( moviename, "strPageURL", document.location.href );
		setvar( moviename, "strBlockID", blockID );
		if(Global.getGlobal('scoreArray')!=null)
		{
			setvar( moviename,'scores',Global.getGlobal('scoreArray'));
		}
	}
	
	if (command == "setPageDone"){
		
		//setvar( moviename, "strPageURL", document.location.href );
		//setvar( moviename, "strBlockID", blockID );
		//if(Global.getGlobal('scoreArray')!=null){window.document.exercisesummaryV2.SetVariable('scores',Global.getGlobal('scoreArray'));}
		Global.setGlobal(args,true)
		//alert("setglobal" + args);
	}
	
	if (command == "getPageDone"){
		var temp = Global.getGlobal(args);
		if (temp != null){setvar( moviename, "pageDone", temp );}
		//alert("getglobal" + args);
	}
	
	if (command == "setB388"){
		var aryArgs = args.split(",");
		Global.setGlobal( "B388a", parseInt(aryArgs[0]) );
		Global.setGlobal( "B388b", parseInt(aryArgs[1]) );
		Global.setGlobal( "B388c", parseInt(aryArgs[2]) );
		//alert("setglobalvar :: " + args);
	}
	
	if (command == "getB388"){
		
		var temp1 = Global.getGlobal("B388a");
		//alert("temp1 :: " + temp1);
		var temp2 = Global.getGlobal("B388b");
		var temp3 = Global.getGlobal("B388c");
		if (temp1 != null) {setvar( moviename, "strNumshow", temp1+","+temp2+","+temp3 );}
		
	}
	
	if (command == "setB391"){
		var aryArgs = args.split(",");
		Global.setGlobal( "B391a", parseInt(aryArgs[0]) );
		Global.setGlobal( "B391b", parseInt(aryArgs[1]) );
		Global.setGlobal( "B391c", parseInt(aryArgs[2]) );
		Global.setGlobal( "B391d", parseInt(aryArgs[3]) );
		Global.setGlobal( "B391e", parseInt(aryArgs[4]) );
		Global.setGlobal( "B391f", parseInt(aryArgs[5]) );
		//alert("setglobalvar :: " + args);
	}
	
	if (command == "getB391"){
		
		var temp1 = Global.getGlobal("B391a");
		var temp2 = Global.getGlobal("B391b");
		var temp3 = Global.getGlobal("B391c");
		var temp4 = Global.getGlobal("B391d");
		var temp5 = Global.getGlobal("B391e");
		var temp6 = Global.getGlobal("B391f");
		if (temp1 != null) {setvar( moviename, "strNumshow", temp1+","+temp2+","+temp3+","+temp4+","+temp5+","+temp6 );}
		
	}
	
	
}

//====================================================
//====================================================
//
// Flash Controls
//
//====================================================
//====================================================

//----------------------------------------------------
// Function to get the correct object reference based on browser type.
// This is different than "movieobject"!!
// It looks for audio swfs (a.swf) first via the audioMovie js variable.
// Then goes to the movieName variable if it doesn't find a specific audio file.
function whichObj( objName ) {

	if ( audioname ) {
		objName = audioname;
		layer = "audio";
	
	} else if ( moviename ) {
		objName = moviename;
		layer = "images";
	
	} else {
		//objName = objName;
	}
	

	if ( document.layers ) {
		
		if ( typeof(document.layers[layer].document.embeds[objName]) != "undefined" ) {
			return document.layers[layer].document.embeds[objName];			
		
		} else {
			//alert("Can't locate " + objName );
		}
		
	} else if ( document.all ) {
		
		if ( typeof document[objName] != "undefined" ) {
			return document[objName];
		
		} else {
			//alert("Can't locate " + objName );
		}
	}
	
	return null;
}

//----------------------------------------------------
function playFlash(obj) {
	// if this is a review page, act normally again -- 
	// -- the user wishes to interact.
	if ( isReview ) {
		isReview = 0;
	}	

	//hideButton( "play" );	// play
	
	var this_object = whichObj( obj );
	if ( this_object == null ) {
		return;
	}
	//this_object.Rewind();
	var checkObj = moviename.slice(-4);
	if (checkObj!="V115"&&checkObj!="x000")
	{
		playMe( obj );
	}
	
	setvar( moviename, "blnPlayChild", true );
	
	// use this line if you have a replay button.
	//
	
	// make the buttons visible again
	//showButton( "rewind" );	// rewind
	//showButton( "pause" );	// pause
	//showButton( "stop" );	// rewind
	
	// recolor the rewind and next button
	RollOverReset( "stop" );
	
	if ( nextPage ) {
		RollOverReset( "next" );
	}
}

//----------------------------------------------------
function pauseFlash( obj ) {
	showButton( "play" );	// play
	
	var this_object = whichObj( moviename );
	if ( this_object == null ) {
		return;
	}
	// pause the main movie
	var checkObj = moviename.slice(-4);
	
	if (checkObj!="V114"&&checkObj!="x000")
	{
		this_object.StopPlay();
	}
	
	setvar( moviename, "blnPauseChild", true );
	
	// pause any alternate movie
	if (secondaryMovie) {
		var this_secondary_object = whichObj( secondaryMovie );
		if ( this_secondary_object == null ) {
			return;
		}
		this_secondary_object.StopPlay();
	}		
}

//----------------------------------------------------
// REPLAY
function rewindFlash(obj) {
	
	if ( obj == "" || obj == null ) {
		return;
	}
	hideButton( "play" );	// play
	var this_object = whichObj( obj );
	var checkObj = moviename.slice(-4);
	if (checkObj!="V115"&&checkObj!="x000")
	{
		this_object.GotoFrame(12);
		this_object.Play();
	}
	
	setvar( moviename, "blnRewindChild", true );
}


function stopFlash( obj ) {
	
	// if this is a review page, act normally again -- 
	// -- the user wishes to interact.
	if ( isReview ) {
		isReview = 0;
	}	
	
	showButton( "play" );	// play
	
	var this_object = whichObj( obj );
	if ( this_object == null ) {
		return;
	}
	
	var checkObj = moviename.slice(-4);
	if (checkObj!="V114"&&checkObj!="x000")
	{
		this_object.GotoFrame(12);
	}
	
	setvar( moviename, "blnStopChild", true );
	
	// use this line if you have a replay button.
	//playMe( obj ); 
	
	// make the buttons visible again
	showButton( "rewind" );	// rewind
	showButton( "pause" );	// pause
	showButton( "stop" );	// rewind
	
	// recolor the rewind and next button
	RollOverReset( "stop" );
		
	if ( nextPage ) {
		RollOverReset( "next" );
	}
}

//----------------------------------------------------
function playMe( obj ) {
	
	var this_object = whichObj( obj );
	if ( this_object == null ) {
		return;
	}

	this_object.Play();
}



//----------------------------------------------------
// show a button.
function showButton( thisButton ) {	

	var thisObject = document.getElementById( thisButton );	
	
	if ( typeof ( thisObject ) == "undefined" ) {
		return;
	}
	
	if ( thisObject ) {
		thisObject.style.visibility = "visible";
	}
}

//----------------------------------------------------
// hide a button.
function hideButton( thisButton ) {	
	var thisObject = document.getElementById( thisButton );	
	thisObject.style.visibility = "hidden";
}


//----------------------------------------------------
// Function called to determine navigation image shown
function RollOverReset( obj ) {
	
	var bobj = "b" + obj;

	if (document.layers) {
		temp = document.layers[obj].document.images[bobj];
	
	} else if (document.all) {
		temp = document.images[bobj];
	}
	
	if ( typeof( temp ) == "undefined" ) { 
		return;
	}
	
	var imgpath = temp.src.split("/images_int/");
	
	if (temp.src.match('.gif') == '.gif') {
		temp.src = imgpath[0] + "/images_int/" + obj + "_en.gif";
	} else {
		temp.src = imgpath[0] + "/images_int/" + obj + "_en.jpg";
	}
	
}

// hidden question popups
function activate (field_name) {
	helpwin = window.open("", 
				"Utopia2000_Help", 
				"resizable=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,copyhistory=0,width=450,height=300");
	helpwin.document.writeln(field_name);                   
	helpwin.document.close();
	helpwin.focus();
}
		
function Show( teaching_point ) {

	// object holder
	var this_content;
	
	// get base name of teaching point
	var baseName = teaching_point.replace( /\d+$/, "" );
	
	//alert( "baseName: " + baseName );
	
	//-------------------------------------------
	// hide all other divs that start with with baseName
	var count  = 0;
	var countMax = 15;
	var active = 1;
	while ( active && (count < countMax) ) {
	
		count++;
		
		hideAttempt = baseName + count;
		
		if ( document.layers ) {
			this_content = document.layers['content'].document.layers[hideAttempt];
			
		} else if ( document.all ) {
			//alert( hideAttempt + " " + typeof( this_content ) );
			if ( typeof( document.all[hideAttempt] ) == "undefined" ) {
				active = 0;
				//alert( "done hiding " + hideAttempt + " doesn't exist. ");
				
			} else {
				this_content = document.all[hideAttempt].style;
			}
			
		} else {
			alert( "No content reference. Sorry. Perhaps you're using NS 6?" );
		}
		
		
		if ( typeof( this_content ) == "undefined" ) {
			// get out of the loop
			active = 0;
			alert( "done hiding " + hideAttempt + " doesn't exist. ");
			
		} else {
			// hide it
			//alert( "hiding " + hideAttempt );		
			this_content.visibility = "hidden";
		}
		
		
	}
	
	//alert( "now show " + teaching_point );

	//-------------------------------------------
	// Show the desired div
	if ( document.layers ) {
		this_content = document.layers['content'].document.layers[teaching_point];
		
	} else if ( document.all ) {
		this_content = document.all[teaching_point].style;
		
	} else {
		alert( "No content reference. Sorry. Perhaps you're using NS 6?" );
	}
	
	// if the object doesn't exist, bail now.
	if ( typeof( this_content) == "undefined" ) {
		if ( debug || _debug ) {
			alert( teaching_point + " object doesn't exist." );
		}
		return;
	}
	
	// show it!
	//alert( "showing " + teaching_point );
	this_content.visibility = "visible";
}

//--------------------------------------------------------------------
// function RollOverGeneric(obj)
//	tacks on _en or _rol for rollover images
//--------------------------------------------------------------------
function RollOverGeneric( obj, override ) {
	var bobj = "b" + obj;

	if (document.layers) {
		temp = document.layers[obj].document.images[bobj];
	} else if (document.all) {
		temp = document.images[bobj];
	}
	
	//var btnDis = (temp.src.slice() == pathDepth+"/images_int/goto_dis.gif");

	if(temp!=null && temp.enabled == "true")
	{
		var imgpath = temp.src.split("/images_int/");
	
		if ( override ) {
		
			// use the override extension
			if (temp.src.match('.gif') == '.gif') {
				temp.src = imgpath[0] + "/images_int/" + obj + "_" + override + ".gif";
			} else {
				temp.src = imgpath[0] + "/images_int/" + obj + "_" + override + ".jpg";
			}
	
		} else if (temp.src.match('_rol') == '_rol') {
			if (temp.src.match('.gif') == '.gif') {
				temp.src = imgpath[0] + "/images_int/" + obj + "_en.gif";
			} else {
				temp.src = imgpath[0] + "/images_int/" + obj + "_en.jpg";
			}
			//statinfo.innerText=statInfoTxt;
		} else {
			if (temp.src.match('.gif') == '.gif') {
				temp.src = imgpath[0] + "/images_int/" + obj + "_rol.gif";
			} else {
				temp.src = imgpath[0] + "/images_int/" + obj + "_rol.jpg";
			}
			//if (temp.alt!=""){statinfo.innerText=temp.alt;}
		}
	}
}


function MouseDownGeneric( obj, override ) {
	var bobj = "b" + obj;

	if (document.layers) {
		temp = document.layers[obj].document.images[bobj];
	} else if (document.all) {
		temp = document.images[bobj];
	}

	var imgpath = temp.src.split("/images_int/");
	
	if(temp!=null && temp.enabled == "true")
	{
		if ( override ) {
		
			// use the override extension
			if (temp.src.match('.gif') == '.gif') {
				temp.src = imgpath[0] + "/images_int/" + obj + "_" + override + ".gif";
			} else {
				temp.src = imgpath[0] + "/images_int/" + obj + "_" + override + ".jpg";
			}
	
		} else if (temp.src.match('_dn') == '_dn') {
			if (temp.src.match('.gif') == '.gif') {
				temp.src = imgpath[0] + "/images_int/" + obj + "_rol.gif";
			} else {
				temp.src = imgpath[0] + "/images_int/" + obj + "_rol.jpg";
			}
			//statinfo.innerText=statInfoTxt;
		} else {
			if (temp.src.match('.gif') == '.gif') {
				temp.src = imgpath[0] + "/images_int/" + obj + "_dn.gif";
			} else {
				temp.src = imgpath[0] + "/images_int/" + obj + "_dn.jpg";
			}
			//if (temp.alt!=""){statinfo.innerText=temp.alt;}
		}
	}
}

function MouseUpGeneric( obj, override ) {
	var bobj = "b" + obj;

	if (document.layers) {
		temp = document.layers[obj].document.images[bobj];
	} else if (document.all) {
		temp = document.images[bobj];
	}

	var imgpath = temp.src.split("/images_int/");
	if(temp!=null && temp.enabled == "true")
	{
		if ( override ) {
		
			// use the override extension
			if (temp.src.match('.gif') == '.gif') {
				temp.src = imgpath[0] + "/images_int/" + obj + "_" + override + ".gif";
			} else {
				temp.src = imgpath[0] + "/images_int/" + obj + "_" + override + ".jpg";
			}
	
		} else if (temp.src.match('_dn') == '_dn') {
			if (temp.src.match('.gif') == '.gif') {
				temp.src = imgpath[0] + "/images_int/" + obj + "_rol.gif";
			} else {
				temp.src = imgpath[0] + "/images_int/" + obj + "_rol.jpg";
			}
			//statinfo.innerText=statInfoTxt;
		} else {
			if (temp.src.match('.gif') == '.gif') {
				temp.src = imgpath[0] + "/images_int/" + obj + "_dn.gif";
			} else {
				temp.src = imgpath[0] + "/images_int/" + obj + "_dn.jpg";
			}
			//if (temp.alt!=""){statinfo.innerText=temp.alt;}
		}
		if(bobj=="boptions"){showOptions();}
		if(bobj=="bcancel"){cancelOptions();}
		if(bobj=="bprint"){printScreen();}
		if(bobj=="bhistory"){goHistory();}
		if(bobj=="bgoto"){gotoPage();}
		if(bobj=="bexit"){getExit();}
		if(bobj=="baudio"){playAudio(moviename);}
		if(bobj=="bvideo"){playVideo(moviename);}
		if(bobj=="bactions"){showActions();}
		if(bobj=="bmore"){showMoreInfo();}
	}
}

function showActions()
{
	setvar( moviename, "blnShowActions", true );
	bactions.src = pathDepth+"/images_int/actions_rol.gif";
}


function showMoreInfo()
{
	
	setvar( moviename, "blnShowMoreInfo", true );
	bmore.src = pathDepth+"/images_int/more_rol.gif";
}


function playAudio(obj) {
		
	var this_object = whichObj( obj );
	if ( this_object == null ) {
		return;
	}

	var checkObj = moviename.slice(-4);
	
	if (checkObj!="V115"&&checkObj!="x000")
	{
		this_object.GotoFrame(12);
		this_object.Play();
	}

	/*if (obj=="timedbulletV115")
	{
		this_object.GotoFrame(14);
		this_object.Play();
	}*/

	setvar( moviename, "blnRewindChild", true );
	baudio.src = pathDepth+"/images_int/audio_rol.gif";
	
}

function playVideo(obj) {
		
	var this_object = whichObj( obj );
	if ( this_object == null ) {
		return;
	}

	var checkObj = moviename.slice(-4);
	if (checkObj!="V115"&&checkObj!="x000")
	{
		this_object.GotoFrame(12);
		this_object.Play();
	}

	setvar( moviename, "blnRewindChild", true );
	bvideo.src = pathDepth+"/images_int/video_rol.gif";
	
}


function initGotoPage()
{
	for(var iLoopCntr=0;iLoopCntr<3;iLoopCntr++)
	{
		<!--eval("arrow"+iLoopCntr+".style.visibility='visible'");-->
		<!--eval("check"+iLoopCntr+".style.visibility='visible'");-->
	}
	parent.content.scrolling="yes";
}

function gotoPage()
{
	//a367p0020.html
	//a386p0030s01p0010.html
	
	var gotoPath = "";
	var scoIndex = "";
	
	if (pageName == "index")
	{
		scoIndex = nextPage.substring(0,1);
	}
	else
	{
		scoIndex = pageName.substring(0,1);
	}
	
	if (pageName.length == 17)
	{
		//gotoPath = "a"+blockID+pageName.slice(4,12)+"goto.html"
		gotoPath = scoIndex+blockID+pageName.slice(4,12)+"goto.html"
	}else{
		//gotoPath = "a"+blockID+"goto.html"
		gotoPath = scoIndex+blockID+"goto.html"
	}
	parent.content.location = gotoPath;
}


var blnAdd2History = true;
function goHistory()
{
	var strHistory = Global.getGlobal("aryHistory");
	if (strHistory != null)
	{
		var strGotoHistory="";
		var strTemp;
		var intTemp = strHistory.length
		var aryNewHistory;
		var blnLastOne = true;
		
		myloop:
		for(var i=0;i<intTemp;i++)
		{
			strTemp = strHistory.charAt(0);
			strHistory = strHistory.slice(1,strHistory.length);
			if(strTemp!=",")
			{
				strGotoHistory = strGotoHistory+strTemp;
			}
			else
			{
				Global.setGlobal("aryHistory", null);
				
				aryNewHistory = strHistory.split(",");
				var intArrayCnt = aryNewHistory.length;
				Global.setGlobal("intHistoryIndex", (intArrayCnt));

				for(var i=0;i<intArrayCnt;i++)
				{
					Global.setGlobal("aryHistory", aryNewHistory[i], i);
				}
				blnLastOne = false;
				break myloop;
			}
		}
		strGotoHistory = strGotoHistory+".html"
		Global.setGlobal("blnAdd2History", false);
		parent.content.location = strGotoHistory;
		if(blnLastOne)
		{
			Global.setGlobal("aryHistory", null);
			Global.setGlobal("intHistoryIndex", 0);
		}
	}
}


function showOptions()
{
	showButton("optBack");
	showButton("cancel");
	showButton("exit");
	showButton("bookMark");
	showButton("print");
}

function cancelOptions()
{
	hideButton("print");
	hideButton("cancel");
	hideButton("exit");
	//hideButton("bookMark");
	hideButton("optBack");
}



//--------------------------------------------------------------------
// Submit DR
//
function idr() {
	TempWindow = window.open("",
	"CSC_TCE_iDR",
	"toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,copyhistory=0,width=550,height=450");
	window.document.dr_form.target = "CSC_TCE_iDR";
	window.document.dr_form.page_url.value = document.location.href;
	//alert( document.location.href );
	window.document.dr_form.submit();
	TempWindow.focus();
}

//--------------------------------------------------------------------
// open a new window with the text that was passed in as a parameter
//
function glossaryPopUp( word, definition ) {

	// set up some constants
	// how editable!
	var bgcolor 		= "#D6E6DB";	
	var my_width  		= 300;
	var my_height 		= 200;
	var my_scrollbars  	= 1;
	
	// open the window
	w = window.open(	"", 
						"glossaryWindow", 
						"resizable=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=" + my_scrollbars + ",copyhistory=0,width=" + my_width + ",height=" + my_height);
	
	// write to it
	w.document.open();
	w.document.writeln("<html><head><title>Definition: " + word + "</title>");
	w.document.writeln("<style>body  {background-color: "+ bgcolor + ";}");
	w.document.writeln("       .word {font-family: Arial, Helvetica, sans-serif; font-size: 12pt; font-weight: bold;   color: #000000;}");
	w.document.writeln("       .def  {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: normal; color: #000000;}");
	w.document.writeln("</style></head><body>");
	w.document.writeln("<div class='word'><p>" + word       + "</p></div>");
	w.document.writeln("<div class='def' ><p>" + definition + "</p></div></body></html>");
	w.document.close();
	
	// bring it to the front
	w.focus();
}

//--------------------------------------------------------------------
// open a new window with the text that was passed in as a parameter
//
function genericPopUp( word, definition ) {

	// set up some constants
	// how editable!
	var bgcolor 		= "#D6E6DB";	
	var my_width  		= 400;
	var my_height 		= 200;
	var my_scrollbars  	= 1;
	
	// open the window
	w = window.open(	"", 
						"glossaryWindow", 
						"resizable=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=" + my_scrollbars + ",copyhistory=0,width=" + my_width + ",height=" + my_height);
	
	// write to it
	w.document.open();
	w.document.writeln("<html><head><title>Term: " + word + "</title>");
	w.document.writeln("<style>body  {background-color: "+ bgcolor + ";}");
	w.document.writeln("       .word {font-family: Arial, Helvetica, sans-serif; font-size: 12pt; font-weight: bold;   color: #000000;}");
	w.document.writeln("       .def  {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: normal; color: #000000;}");
	w.document.writeln("</style></head><body>");
	w.document.writeln("<div class='word'><p>" + word       + "</p></div>");
	w.document.writeln("<div class='def' ><p>" + definition + "</p></div></body></html>");
	w.document.close();
	
	// bring it to the front
	w.focus();
}

//--------------------------------------------------------------------
// open a new window with the text that was passed in as a parameter
//
function graphicPopUp( word, definition ) {

	// set up some constants
	// how editable!
	var bgcolor 		= "#FFFFFF";	
	var my_width  		= 400;
	var my_height 		= 400;
	var my_scrollbars  	= 1;
	
	// open the window
	w = window.open(	"", 
						"graphicWindow", 
						"resizable=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=" + my_scrollbars + ",copyhistory=0,width=" + my_width + ",height=" + my_height);
	
	// write to it
	w.document.open();
	w.document.writeln("<html><head><title>Graphic Popup</title>");
	w.document.writeln("<style>body  {background-color: "+ bgcolor + ";}");
	w.document.writeln("       .word {font-family: Arial, Helvetica, sans-serif; font-size: 12pt; font-weight: bold;   color: #000000;}");
	w.document.writeln("       .def  {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: normal; color: #000000;}");
	w.document.writeln("</style></head><body>");
	w.document.writeln("<div class='word'><p>" + word       + "</p></div>");
	w.document.writeln("<div class='def' ><p><img src=\"" + definition + "\"></p></div></body></html>");
	w.document.close();
	
	// bring it to the front
	w.focus();
}

//------------------------------Revised open window for 52D10 11 29 rob m
function openCenter2(myurl){
      
	
   windowNavi = window.open(myurl,"DLXXI","toolbar=no,width=500,height=310,menubar=yes,status=yes,scrollbars=no,resizable=no");
   windowNavi.moveTo(((screen.width/2)-389),((screen.height/2)-265))
   windowNavi.location = myurl;
   windowNavi.focus();
}

//--------------------------------------------------------------------
// open a new window with the text that was passed in as a parameter
//
function MC_check( content, distractor, code, base_dir ) {
	
	// initialize the default background color and text color
	// DO feel free to change these.
	var bgcolor 		= "#E0E7EF";	// light blue
	var txcolor 		= "#000000";	// black
	
	// images are optional. Set them to empty strings if you don't want them
	// DO feel free to change the filename, width, height, alignment, border and alt tag.
	// DO NOT change the "base_dir" or "image_int" part of the src attribute. These are required!
	var correct_image	= "<br /><img src='" + pathDepth+"/images_int/correct.jpg'   width='30' height='30' align='left' border='0' alt='green check'>";
	var incorrect_image	= "<br /><img src='" + pathDepth+"/images_int/incorrect.jpg' width='30' height='30' align='left' border='0' alt='red x'>";
	
	// uncomment this if you want no images
	// correct_image = "";
	// incorrect_iamge = "";	
	
	// initialize review to null. Required.
	var review			= "";
	
	// The "remediation_page" variable created by Utopia2000 and stuck on the HTML page (if a remediation page was identified for the question)
	// DO NOT change the check
	// DO NOT change the JS call (should call 'gotoRemediation').
	// DO feel free to change the text in side the anchor tags. If you add an image, make sure it follows the image tag style for the correct/incorrect imges
	//    that means it uses base_dir and images_int.
	// DO feel free to change the leading <br> Tag with something else, like a <p> tag.
	if ( remediation_page ) {
		review			= "<br><a href='javascript:gotoRemediation(\""+ remediation_page + "\")'>Review material for this question.</a>";
	}
	
	// increment now since it starts at zero
	// DO NOT change this.
	curr_tries++;	
	
	// if we're past the max number of tries do NOTHING
	if ( curr_tries > num_tries ) {
		// DO feel free to change this alert content.
		alert( "You have completed this question." );
		return;
	}
	
	if ( code == 'true' || code == 't' ) {
	
		// max out num tries to end question
		// but do it so we can figure out how many tries it took!
		// DO NOT change this.
		curr_tries += 100;
		
		// make the content equal to the image and the original content (unique feedback for each question)
		// DO NOT change this. (if you don't want an image, set the variable to null at the top of the function.
		// DO feel free to change the <p> tag to null, or something else.
		content = correct_image + content;
	
		// without question answer echoed
		// DO feel free to hard code an additional, permanent distractor (title) here
		distractor = "";
				
	} else {
		// assume they got it wrong
		
		// change background color to red
		// DO feel free to change the background colors (here, only for incorrect responses)
		//bgcolor 		= "#ff8888";	// light red
		//txcolor 		= "#000000";	// black
		
		// with question answer echoed
		// DO feel free to hard code an additional, permanent distractor (title) here
		// distractor += " is incorrect.";
	
		// without question answer echoed
		// DO feel free to hard code an additional, permanent distractor (title) here
		distractor = "";
	
		if ( curr_tries == num_tries ) {
			// make the content equal to the image and the final incorrect feedback.
			// if review is active, it will be added here. otherwise it defaulted to null and will cause no problems.
			// DO NOT change this. (if you don't want an image, set the variable to null at the top of the function.)
			// DO feel free to change the <p> tag to null, or something else.
			content = incorrect_image + final_feedback_incorrect + review;
		}
		if ( curr_tries < num_tries ) {
			// make the content equal to the image and the partial feedback
			// DO NOT change this. (if you don't want an image, set the variable to null at the top of the function.)
			// DO feel free to change the <p> tag to null, or something else.
			// DO feel free to add additional hard coded messages ( like "try again") to the null string between incorrect_image and content
			content = incorrect_image + "" + content;
		} 
	}
	
	
	// open the window
	// DO NOT change this.
	Question_Popup( distractor, content, bgcolor, txcolor, base_dir )
}


//--------------------------------------------------------------------
// open a new window with the text that was passed in as a parameter
//
function Question_Popup( distractor, content, bgcolor, txcolor, base_dir ) {	
	
	var bgimage			= "images_int/popup_background.jpg";
	var my_width  		= 400;
	var my_height 		= 300;
	var my_scrollbars  	= 1;
	var CLOSE 			= get_close( base_dir );
	var PRINT			= get_print( base_dir );
	
	// open the window
	w = window.open(	"", 
						"questionResponse", 
						"resizable=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=" + my_scrollbars + ",copyhistory=0,width=" + my_width + ",height=" + my_height);

	w.document.open();
	w.document.writeln("<html><head><title>Question Response</title>");
	
	// if there is a base_dir, try to use a background image ON TOP OF a solid color
	// this will cause no error if the image doesn't exist
	// if no base_dir, then just use a solid color.
	if ( base_dir ) {
		w.document.writeln("<script type='text/javascript'>function gotoRemediation( thisPage ) { window.opener.location = thisPage; window.self.close(); }</script>");
		w.document.writeln("<style type='text/css'>body  {background-color: "+ bgcolor + "; background-image: url('" + base_dir + "/" +  bgimage + "'); background-repeat: no-repeat;}");
	} else {
		w.document.writeln("<style type='text/css'>body  {background-color: "+ bgcolor + ";}");		
	}
	
	
	w.document.writeln("       .word {font-family: Arial, Helvetica, sans-serif; font-size: 12pt; font-weight: bold;   color: " + txcolor + ";}");
	w.document.writeln("       .def  {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: normal; color: " + txcolor + ";}");
	w.document.writeln("</style></head><body>");
	w.document.writeln("<div class='word'><p>" + distractor + "</p></div>");
	w.document.writeln("<div class='def' ><p>" + content    + "</p><p><a href='javascript:self.close()'>" + CLOSE + "</a></p></div></body></html>");
	w.document.close();
	
	// bring it to the front
	w.focus();
}


function enableButton(btn)
{
	eval("b"+btn+".enabled = 'true'");
	eval("b"+btn+".src = '"+pathDepth+"/images_int/"+btn+"_en.gif'");
	//alert(eval("b"+btn+".enabled"));
}

function disableButton(btn)
{
	eval("b"+btn+".src = '"+pathDepth+"/images_int/"+btn+"_dis.gif'");
	eval("b"+btn+".enabled = 'false'");
}

function initToolbar()
{
	var pageType = pageName.slice(0,1);
	var nextPageType = nextPage.slice(0,1);
	var intHistoryIndex = Global.getGlobal("intHistoryIndex")
	
	if (intHistoryIndex == null)intHistoryIndex=0;
	
	if (pageType == "b" || pageType == "d" || pageType == "f" || pageType == "h" || pageType == "j")
	{
		bgoto.src = pathDepth+"/images_int/goto_dis.gif";
		bgoto.enabled = "false";
	}
	if (pageType == "i")
	{
		if(nextPageType == "b" || nextPageType == "d" || nextPageType == "f" || nextPageType == "h" || nextPageType == "j")
		{
			bgoto.src = pathDepth+"/images_int/goto_dis.gif";
			bgoto.enabled = "false";
		}
	}

	if (intHistoryIndex < 1)
	{
		bhistory.src = pathDepth+"/images_int/history_dis.gif";
		bhistory.enabled = "false";
	}
	
	
}


function initPage()
{
	preloadtoolbar();
	
	Global.setGlobal("blnAdd2History", true);
	initToolbar();
}

function getGlobalVar(strVarName, lngIndex)
{
	strVarName = new String(strVarName);

	if(strVarName.length == 0 || !isNaN(strVarName))
	{
		alert("Invalid global variable name '" + strVarName + "'");
		return;
	}

	if(parent.storage)
	{
		if(lngIndex != null && isNaN(lngIndex) == false && parent.storage[strVarName] != null)
			return parent.storage[strVarName][lngIndex];
		else
		{
			if(parent.storage[strVarName] != null)
			{
				if(parent.storage[strVarName].length > 0)
				{
					//For some reason, the join() function throws an error in IE under certain conditions, so
					//just cobble togther the string manually instead.
					var strResult = new String();
					for(var i=0;i<parent.storage[strVarName].length;i++)
						strResult += ((parent.storage[strVarName][i]!=null?parent.storage[strVarName][i]:null) + ",");
					return strResult.substr(0, strResult.length-1);
				}
				else
					return parent.storage[strVarName];
			}
			else
				return null;
		}
	}
	else
		return null;
}



function setGlobalVar(strVarName, vntVarValue, lngIndex)
{
	strVarName = new String(strVarName);
	if(strVarName.length == 0 || !isNaN(strVarName))
	{
		alert("Invalid global variable name '" + strVarName + "'");
		return;
	}
	
	if(parent.storage)
	{
		if(lngIndex != null && isNaN(lngIndex) == false)
		{
			if(parent.storage[strVarName] == null)
			{
				parent.storage[strVarName] = new Array();
			}
			parent.storage[strVarName][lngIndex] = vntVarValue;
		}
		else
			parent.storage[strVarName] = vntVarValue;
	}
}

function canSetGlobals()
{
	return parent.storage != null
}

function GlobalVars()
{
	this.getGlobal = getGlobalVar;
	this.setGlobal = setGlobalVar;
	this.canSetGlobals = canSetGlobals;
}

var Global = new GlobalVars();
var strPrevPage="";
strPrevPage = Global.getGlobal('prevPage',0);

function openCalc()
{
	var calcwindow = window.open("../../images/calculator.swf","Calculator","height=340,width=260,toolbar=no,scrollbars=no");
}

function printScreen()
{
	window.print();
}

function confirmExit()
{
	var value;
	value = confirm("Are you sure you want to exit this section?");
	return value;
}

function getExit()
{
	//if (ccwinopen == true)
	//{
	//	if (ccwin) ccwin.close();
	//}
	if (referencewinopen == true)
	{
		referencewin.close();
	}

	
	if (confirmExit())
	{
		//endSCO( "logout" );
      	setTimeout( "closeMyWindow()", 1000 );
	}
}

function closeMyWindow() 
{
      top.window.close();
}

function openHelp(launchType)
{
	//var helpwindow = window.open("../../images/help.swf","Help","height=560,width=790,toolbar=no,scrollbars=no");
	var bgcolor 		= "#E0E7EF";	// light blue
	 
	
	helpwin = window.open("", 
				"Help", 
				"toolbar=no,scrollbars=no,copyhistory=0,width=790,height=560");
	helpwin.document.writeln("<html><head><title>Help</title>");

	helpwin.document.writeln("<script>");
	helpwin.document.writeln("function closeMyWindow(){top.window.close();}var launchType = \""+launchType+"\";");
	helpwin.document.writeln("</script>");
	helpwin.document.writeln("</head>");
	
	helpwin.document.writeln("<body bgcolor='#F2F2F2' onLoad='window.opener.helpwinopen=true;' onUnload='window.opener.helpwinopen=false'>");
	helpwin.document.writeln('<div id="image" style="position:absolute; width:790px; height560px; left: 0px; top: 0px;">');
	helpwin.document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="790" height="560" id="help" align="middle">');
	helpwin.document.writeln('<param name="allowScriptAccess" value="sameDomain" />');
	helpwin.document.writeln('<param name="movie" value="../../images/help.swf" />');
	helpwin.document.writeln('<param name="quality" value="high" />');
	helpwin.document.writeln('<param name="bgcolor" value="#ffffff" />');
	helpwin.document.writeln('<embed src="../../images/help.swf" quality="high" bgcolor="#ffffff" width="790" height="560" name="help" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	helpwin.document.writeln('</object>');
	helpwin.document.writeln('</div>');

	helpwin.document.writeln("</body></html>");
	helpwin.document.close();
	helpwin.focus();
}

// Prompt user to view help demo once
function playHelpDemoOnce()
{
	//if(prevPage=='')openHelp('index')
	if(prevPage=='')
	{	
		if(Global.getGlobal('viewedHelpDemo') == null)
		{
			Global.setGlobal('viewedHelpDemo', 'true');
			openHelp('index');
		}
	}
	
}

var statInfoTxt="";

function preloadtoolbar()
{
	baudio.enabled = "true";
	boptions.enabled = "true";
	bhistory.enabled = "true";
	bback.enabled = "true";
	bgoto.enabled = "true";
	bnext.enabled = "true";
	bcancel.enabled = "true";
	bexit.enabled = "true";
	bprint.enabled = "true";
	/*bactions.enabled = "false";
	bvideo.enabled = "false";
	bmore.enabled = "false";
	*/
	
	actionsEn = new Image();
	actionsEn.src = pathDepth+"/images_int/actions_en.gif";
	actionsRol = new Image();
	actionsRol.src = pathDepth+"/images_int/actions_rol.gif"; 
	actionsDis = new Image();
	actionsDis.src = pathDepth+"/images_int/actions_dis.gif";
	actionsDn = new Image();
	actionsDn.src = pathDepth+"/images_int/actions_dn.gif";
	
	audioEn = new Image();
	audioEn.src = pathDepth+"/images_int/audio_en.gif";
	audioRol = new Image();
	audioRol.src = pathDepth+"/images_int/audio_rol.gif"; 
	audioDis = new Image();
	audioDis.src = pathDepth+"/images_int/audio_dis.gif";
	audioDn = new Image();
	audioDn.src = pathDepth+"/images_int/audio_dn.gif";
	
	videoEn = new Image();
	videoEn.src = pathDepth+"/images_int/video_en.gif";
	videoRol = new Image();
	videoRol.src = pathDepth+"/images_int/video_rol.gif"; 
	videoDis = new Image();
	videoDis.src = pathDepth+"/images_int/video_dis.gif";
	videoDn = new Image();
	videoDn.src = pathDepth+"/images_int/video_dn.gif";
	
	moreEn = new Image();
	moreEn.src = pathDepth+"/images_int/more_en.gif";
	moreRol = new Image();
	moreRol.src = pathDepth+"/images_int/more_rol.gif"; 
	moreDis = new Image();
	moreDis.src = pathDepth+"/images_int/more_dis.gif";
	moreDn = new Image();
	moreDn.src = pathDepth+"/images_int/more_dn.gif";
	
	optionsEn = new Image();
	optionsEn.src = pathDepth+"/images_int/options_en.gif";
	optionsRol = new Image();
	optionsRol.src = pathDepth+"/images_int/options_rol.gif"; 
	optionsDis = new Image();
	optionsDis.src = pathDepth+"/images_int/options_dis.gif";
	optionsDn = new Image();
	optionsDn.src = pathDepth+"/images_int/options_dn.gif";
	
	historyEn = new Image();
	historyEn.src = pathDepth+"/images_int/history_en.gif";
	historyRol = new Image();
	historyRol.src = pathDepth+"/images_int/history_rol.gif"; 
	historyDis = new Image();
	historyDis.src = pathDepth+"/images_int/history_dis.gif";
	historyDn = new Image();
	historyDn.src = pathDepth+"/images_int/history_dn.gif";
	
	nextEn = new Image();
	nextEn.src = pathDepth+"/images_int/next_en.gif";
	nextDis = new Image();
	nextDis.src = pathDepth+"/images_int/next_dis.gif";
	nextDn = new Image();
	nextDn.src = pathDepth+"/images_int/next_dn.gif";
	nextRol = new Image();
	nextRol.src = pathDepth+"/images_int/next_rol.gif";
	
	gotoEn = new Image();
	gotoEn.src = pathDepth+"/images_int/goto_en.gif";
	gotoDis = new Image();
	gotoDis.src = pathDepth+"/images_int/goto_dis.gif";
	gotoDn = new Image();
	gotoDn.src = pathDepth+"/images_int/goto_dn.gif";
	gotoRol = new Image();
	gotoRol.src = pathDepth+"/images_int/goto_rol.gif";
	
	backEn = new Image();
	backEn.src = pathDepth+"/images_int/back_en.gif";
	backDis = new Image();
	backDis.src = pathDepth+"/images_int/back_dis.gif";
	backDn = new Image();
	backDn.src = pathDepth+"/images_int/back_dn.gif";
	backRol = new Image();
	backRol.src = pathDepth+"/images_int/back_rol.gif";
	
	cancelEn = new Image();
	cancelEn.src = pathDepth+"/images_int/cancel_en.gif";
	cancelRol = new Image();
	cancelRol.src = pathDepth+"/images_int/cancel_rol.gif"; 
	cancelDis = new Image();
	cancelDis.src = pathDepth+"/images_int/cancel_dis.gif";
	cancelDn = new Image();
	cancelDn.src = pathDepth+"/images_int/cancel_dn.gif";
	
	exitEn = new Image();
	exitEn.src = pathDepth+"/images_int/exit_en.gif";
	exitRol = new Image();
	exitRol.src = pathDepth+"/images_int/exit_rol.gif"; 
	exitDis = new Image();
	exitDis.src = pathDepth+"/images_int/exit_dis.gif";
	exitDn = new Image();
	exitDn.src = pathDepth+"/images_int/exit_dn.gif";
	
	bookmarkEn = new Image();
	bookmarkEn.src = pathDepth+"/images_int/bookmark_en.gif";
	bookmarkRol = new Image();
	bookmarkRol.src = pathDepth+"/images_int/bookmark_rol.gif"; 
	bookmarkDis = new Image();
	bookmarkDis.src = pathDepth+"/images_int/bookmark_dis.gif";
	bookmarkDn = new Image();
	bookmarkDn.src = pathDepth+"/images_int/bookmark_dn.gif";
	
	printEn = new Image();
	printEn.src = pathDepth+"/images_int/print_en.gif";
	printRol = new Image();
	printRol.src = pathDepth+"/images_int/print_rol.gif"; 
	printDis = new Image();
	printDis.src = pathDepth+"/images_int/print_dis.gif";
	printDn = new Image();
	printDn.src = pathDepth+"/images_int/print_dn.gif";
	
	
}




function highlightNextButton()
{
	if(nextPage == "")
	{
		RollOverGeneric('next','dis');
	}
	else if(nextPage == null)
	{
		RollOverGeneric('next','dis');
	} 
	else
	{
		//statinfo.innerText="Click the forward arrow to continue"; 
		RollOverGeneric('next','en2');	
	}
}

var referencewinopen=false;
var referencewin = null;

function openReference()
{
	referencewin = window.open("","Reference","toolbar=no,status=yes,resizable=yes,copyhistory=0,width=610,height=410");
	referencewin.document.writeln("<html><head><title>References</title>");
	referencewin.document.writeln("<body bgcolor='#ffffff' onLoad='window.opener.referencewinopen=true;' onUnload='window.opener.referencewinopen=false'>");
	referencewin.document.writeln('<div id="image" style="position:absolute; width:790px; height553px; left: 0px; top: 0px;">');
	referencewin.document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="600" height="400" id="reference" align="middle">');
	referencewin.document.writeln('<param name="allowScriptAccess" value="sameDomain" />');

	referencewin.document.writeln('<param name="movie" value="../../images/'+blockID+'reference.swf" />');
	
	referencewin.document.writeln('<param name="quality" value="high" />');
	referencewin.document.writeln('<param name="bgcolor" value="#FFFFFF" />');

	referencewin.document.writeln('<embed src="../../images/'+blockID+'reference.swf" quality="high" bgcolor="#FFFFFF" width="600" height="400" name="reference" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	
	referencewin.document.writeln('</object>');
	referencewin.document.writeln('</div>');
	referencewin.document.writeln("</body></html>");
	referencewin.document.close();
	referencewin.focus();
}

function setPrevPage()
{
	strPrevPage = pageName
	Global.setGlobal('prevPage',strPrevPage,0);
	
	blnAdd2History = Global.getGlobal("blnAdd2History");

	if(blnAdd2History)
	{
		var strHistory;
		var intHistoryIndex = Global.getGlobal("intHistoryIndex");
	
		if(strPrevPage != null)
		{
			parseInt(intHistoryIndex);
			var intTemp = intHistoryIndex;
	
			for(var i=0, j=intHistoryIndex;i<intHistoryIndex;i++, j--)
			{
				strHistory = Global.getGlobal("aryHistory", (intTemp-1));
				Global.setGlobal("aryHistory", strHistory, j);
				intTemp--;
			}
			Global.setGlobal("aryHistory", strPrevPage, 0);
			intHistoryIndex++;

			if(intHistoryIndex>9)intHistoryIndex=9;
			Global.setGlobal("intHistoryIndex", intHistoryIndex);
		}
		else
		{
			Global.setGlobal("intHistoryIndex", 0);
		}
	}
	
}


var ccwinopen=false;

function showClosedCaption () 
{
	var bgcolor 		= "#ffffff";	// white
	
	ccwin = window.open("", 
				"Closed_Caption", 
				"resizable=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,copyhistory=0,width=450,height=300");
	ccwin.document.writeln("<html><head><title>Print Page Audio</title>");
	ccwin.document.writeln("<style type='text/css'>body  {background-color: "+ bgcolor + ";}</style><script language='JavaScript'>var printMO='../../images_int/print02.jpg'; var printREG='../../images_int/print01.jpg'; var closeMO='../../images_int/close2.jpg'; var closeREG='../../images_int/close1.jpg';</script></head>");
	
	ccwin.document.writeln("<body onLoad='window.opener.ccwinopen=true' onUnload='window.opener.ccwinopen=false'>");
	ccwin.document.writeln(narration);
	ccwin.document.writeln("<DIV width='100%' style='text-align:right'>");
	ccwin.document.writeln("<a href='javascript:print()' onMouseOver='document.images[0].src = printMO;' onMouseOut='document.images[0].src = printREG;'><img src='../../images_int/print01.jpg' width='60' height='20' name='print' border='0'></a>");
	ccwin.document.writeln("<a href='javascript:window.close()' onMouseOver='document.images[1].src = closeMO;' onMouseOut='document.images[1].src = closeREG;'><img src='../../images_int/close1.jpg' width='60' height='20' name='closeWin' border='0'></a>");
	ccwin.document.writeln("</DIV>");
	ccwin.document.writeln("</body></html>");
	ccwin.document.close();
	ccwin.focus();
}

var disMenuBtn = true;

function menuCheck(page,next)
{
	if(page.substring(0,1) != "c" && next.substring(0,1) != "c")
	{
		RollOverGeneric('menu','dis');
		disMenuBtn = true;
	}
	else
	{
		disMenuBtn = false;
	}
}
